package com.lindroy.androidplayer.logic.model.bean

import android.os.Parcelable
import com.lindroy.androidplayer.R
import com.lindroy.androidplayer.extensions.no
import com.lindroy.androidplayer.extensions.yes
import kotlinx.android.parcel.Parcelize

/**
 * @author Lin
 * @date 2021/4/24
 * @function 网页文章页面所需的数据类
 */
@Parcelize
data class ContentBean(
    val id: Int = 0,
    val url: String = "",
    val title: String = "",
    var collected: Boolean = false,
    val collectedType: Int = TYPE_ARTICLE
) : Parcelable {

    val collectedIconId: Int
        get() = collected.yes { R.drawable.ic_collection_selected }
            .no { R.drawable.ic_collection_unselected_solid }

    companion object {
        //文章
        const val TYPE_ARTICLE = 0

        //url
        const val TYPE_URL = 1
    }

}